<!DOCTYPE html>
<html lang=''>

<head>
    <meta charset='UTF-8'>
    <meta http-equiv='X-UA-Compatible' content='IE=edge'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <title>Document</title>
    <script src='./vue.js'></script>
</head>

<body>
    <div id='app'>
        <div>
            {{ state.count }}
            <button @click="state.count++">增加</button>
        </div>
    </div>
</body>
<script>

    // readonly 是用来定义只读数据用的，如果去修改，那么会给一个警告
    const { readonly } = Vue

    const app = Vue.createApp({
        setup (props, context) {

            let state = readonly({
                count: 100
            })

            return {
                state
            }
        }
    })
    app.mount('#app')
</script>

</html>